
#include <stdio.h>
#include "console.h"
#include "sysdef.h"
#include "appload.h"

void uart_example(void *argv) {
    argv = argv;
	uint8_t ch;
    uart_t *console = console_get_dev();
    int ret = 0;

	if(!console)
		goto exit;
    
    while(1) {
        ret = console->read(&ch, 1, OS_WAIT_FOREVER);
        if(ret == 1)
        {
            putchar((int)ch);
        }
    }

exit:
	return;
}

app_export(uart_example, NULL, "uart_example", 1024, 30, 1);